package com.zh.service.impl;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

import com.zh.pojo.domain.Customer;
import com.zh.pojo.domain.CustomerWallet;
import com.zh.mapper.CustomerWalletMapper;
import com.zh.service.ICustomerWalletService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 乘客的钱包 服务实现类
 * </p>
 *
 * @author 初四
 * @since 2024-06-13
 */
@Service
public class CustomerWalletServiceImpl extends ServiceImpl<CustomerWalletMapper, CustomerWallet> implements ICustomerWalletService {

    /**
     * 保存乘客钱包信息
     * @param customer
     */
    @Override
    public void saveCustomerWallet(Customer customer) {
        CustomerWallet customerWallet = new CustomerWallet();
        customerWallet.setId(customer.getId());
        customerWallet.setAmount(BigDecimal.ZERO);
        customerWallet.setCreateTime(new Date());
        customerWallet.setTotalRecharge(BigDecimal.ZERO);
        customerWallet.setTotalWithdraw(BigDecimal.ZERO);
        super.save(customerWallet);
    }
}
